package de.gwtprime.client.event;

import com.google.gwt.event.shared.GwtEvent;

import de.gwtprime.client.event.handler.PaymentTriggeredEventHandler;
import de.gwtprime.shared.requestFactory.OrderProxy;

public class PaymentTriggeredEvent extends GwtEvent<PaymentTriggeredEventHandler>{
	
	public static Type<PaymentTriggeredEventHandler> TYPE = new Type<PaymentTriggeredEventHandler>(); 
	
	private OrderProxy order;
	
	public PaymentTriggeredEvent(OrderProxy order) {
		this.setAnswer(order);
	}

	@Override
	protected void dispatch(PaymentTriggeredEventHandler handler) {
		handler.onPaymentTriggered(this);
	}

	@Override
	public Type<PaymentTriggeredEventHandler> getAssociatedType() {
		return TYPE;
	}

	public OrderProxy getAnswer() {
		return order;
	}

	public void setAnswer(OrderProxy order) {
		this.order = order;
	}
}
